package DAO.mysql;

import DAO.ICodeDAO;
import DAO.IDAO;
import DAO.IWordCodeDAO;
import DAO.IWordDAO;

public class MySQLDAO implements IDAO {
	private MySQLConnectionPool pool;
	
	public MySQLDAO() {
		pool = new MySQLConnectionPool(
				"com.mysql.jdbc.Driver", "jdbc:mysql://localhost:3306/naturalJava",
				"root", "root");
	}

	@Override
	public ICodeDAO getCodeDAO() {
		return new MySQLCodeDAO(pool);
	}
	
	public IWordDAO getWordDAO() {
		return new MySQLWordDAO(pool);
	}

	@Override
	public IWordCodeDAO getWordCodeDAO() {
		return new MySQLWordCodeDAO(pool, this);
	}
}
